<?php
class QinUtility
{
  // param:
  // array $opts, each item as key=>val,
  static public function make_options(array $opts=null, $select=null)
  {
    if (!isset($opts) || empty($opts))
      return "";
    $str = "<option value='0'>请选择</option>";
    foreach($opts as $key=>$val)
      {
	$sel = $key == $select ? 'selected' : '';
	$str .= "<option value='$key' $sel>$val</option>";
      }
    return $str;
  }

}
